import request from '@/utils/request';
import { unionApiUrl } from '@/api/config.js';
const apiRul = unionApiUrl;
// const apiRul = process.env.NODE_ENV == 'development' ? '/union-producer-server-yuantao' : unionApiUrl;
/**
 * 根据管理权限查询党员组织机构树
 * @param data
 */
export function queryTreeList(data){
  return request({
    url: `${apiRul}/partyOrganization/queryTreeList`,
    method: 'post',
    data: data
  })
}

/**
 * 查询所有党员组织机构树
 * @param data
 */
export function queryAllTreeList(data){
  return request({
    url: `${apiRul}/partyOrganization/queryAllTreeList`,
    method: 'post',
    data: data
  })
}

/**
 * 根据父级id查询组织类型
 * @param data
 */
export function queryOrgTypeByParentId(data){
  return request({
    url: `${apiRul}/partyOrganization/queryOrgTypeByParentId`,
    method: 'get',
    params: data
  })
}

/**
 * 添加党员组织机构
 * @param data
 */
export function insertSelective(data){
  return request({
    url: `${apiRul}/partyOrganization/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 组织信息列表分页查询
 * @param data
 */
export function getPagePartyOrganization(data){
  return request({
    url: `${apiRul}/partyOrganization/getPartyOrgByIdAndSearch`,
    method: 'post',
    data: data
  })
}

/**
 * 获取党员组织机构信息
 * @param data
 */
export function getPartyOrganizationById(params){
  return request({
    url: `${apiRul}/partyOrganization/getPartyOrganizationById`,
    method: 'get',
    params
  })
}

/**
 * 条件查询党员信息
 * @param data
 */
export function queryAllPartyMemberList(data){
  return request({
    url: `${apiRul}/partyMember/queryAllPartyMemberList`,
    method: 'post',
    data: data
  })
}

/**
 * 组织信息设置
 * @param data
 */
export function updateByPrimaryKeySelective(data){
  return request({
    url: `${apiRul}/partyOrganization/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 撤销党员组织机构对象
 * @param data
 */
export function cancelByPrimaryKey(data){
  return request({
    url: `${apiRul}/partyOrganization/cancelByPrimaryKey`,
    method: 'post',
    data: data
  })
}

/**
 * 获取党员组织机构信息（查看接口）
 * @param data
 */
export function getPartyOrgAllById(data){
  return request({
    url: `${apiRul}/partyOrganization/getPartyOrgAllById`,
    method: 'get',
    params: data
  })
}

/**
 * 党员分页查询
 * @param data
 */
export function getPagePartyMember(data){
  return request({
    url: `${apiRul}/partyMember/getPagePartyMember`,
    method: 'post',
    data: data
  })
}

/**
 * 添加党员信息
 * @param data
 */
export function addPartyMember(data){
  return request({
    url: `${apiRul}/partyMember/insertSelective`,
    method: 'post',
    data: data
  })
}


/**
 * 批量添加党员信息
 */
 export function batchAddPartyMember(data) {
  return request({
    url: `${apiRul}/partyMember/batchInsertSelective`,
    method: 'post',
    data
  })
}

/**
 * 修改党员信息
 * @param data
 */
export function updatePartyMember(data){
  return request({
    url: `${apiRul}/partyMember/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 获取党员信息信息
 * @param data
 */
export function getPartyMemberById(data){
  return request({
    url: `${apiRul}/partyMember/getPartyMemberById`,
    method: 'get',
    params: data
  })
}

/**
 * 党员缴费记录分页查询
 * @param data
 */
export function getPagePartyMemberDues(data){
  return request({
    url: `${apiRul}/partyMemberDues/getPagePartyMemberDues`,
    method: 'post',
    data: data
  })
}

/**
 * 党员发展记录分页查询
 * @param data
 */
export function getPagePartyMemberDevelopment(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/getPagePartyMemberDevelopment`,
    method: 'post',
    data: data
  })
}

/**
 * 添加党费收缴记录
 * @param data
 */
export function memberDuesInsertSelective(data){
  return request({
    url: `${apiRul}/partyMemberDues/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 获取党费收缴记录信息
 * @param data
 */
export function getPartyMemberDuesById(data){
  return request({
    url: `${apiRul}/partyMemberDues/getPartyMemberDuesById`,
    method: 'get',
    params: data
  })
}

/**
 * 修改党费收缴记录信息
 * @param data
 */
export function updateMemberDues(data){
  return request({
    url: `${apiRul}/partyMemberDues/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 删除党费收缴记录
 * @param data
 */
export function deleteMemberDues(data){
  return request({
    url: `${apiRul}/partyMemberDues/deleteByPrimaryKey`,
    method: 'post',
    data: data
  })
}


/**
 * 添加党员发展记录
 * @param data
 */
export function memberDevelopmentInsertSelective(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/insertSelective`,
    method: 'post',
    data: data
  })
}

/**
 * 修改党员发展记录
 * @param data
 */
export function updateByPartyMemberDevelopment(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 删除党员发展记录
 * @param data
 */
export function deleteDevelopment(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/deleteByPrimaryKey`,
    method: 'post',
    data: data
  })
}


/**
 * 获取党员发展记录信息
 * @param data
 */
export function getPartyMemberDevelopmentById(data){
  return request({
    url: `${apiRul}/partyMemberDevelopment/getPartyMemberDevelopmentById`,
    method: 'get',
    params: data
  })
}

/**
 * 查询可添加为党员的员工
 * @param data
 */
export function getPartyMemberByUserOrgId(data){
  return request({
    url: `${apiRul}/partyMember/getPartyMemberByUserOrgId`,
    method: 'post',
    data: data
  })
}

/**
 * 党员对内转出
 * @param data
 */
export function inwardTransfer(data){
  return request({
    url: `${apiRul}/partyMember/inwardTransfer`,
    method: 'post',
    data: data
  })
}
/**
 * 党员对内转出流程详情
 * @param data
 */
export function getPartyMemberBybusinessId(data){
  return request({
    url: `${apiRul}/partyMember/partyMemberInfoById`,
    method: 'get',
    params: data
  })
}
/**
 * 党员对外转出
 * @param data
 */
export function transferOut(data){
  return request({
    url: `${apiRul}/partyMember/transferOut`,
    method: 'post',
    data: data
  })
}

/**
 * 查询当前登录人的党组织管理等级
 */
export function getCurrentPartyLevel(data) {
  return request({
    url: unionApiUrl + '/partyOrganization/queryOrgLevelByLoginUser',
    method: 'post',
    data
  })
}

/**
 * 查询当前登录人的团组织管理等级
 */
 export function getCurrentLeagueLevel(data) {
  return request({
    url: unionApiUrl + '/youthOrganization/queryOrgLevelByLoginUser',
    method: 'post',
    data
  })
}



/**
 * 导入党费收缴记录
 */
export function importPartyFeeRecords(data) {
  return request({
    url: `${apiRul}/partyMember/importPartyFeeRecords`,
    method: 'post',
    data
  })
}

